package com.neuedu.myweather;


import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

/**
 * 自定义分区类
 *
 * @author
 */
public class YearPartitioner extends Partitioner<WeatherWritable, Text> {
    @Override
    public int getPartition(WeatherWritable weatherWritable, Text text, int numPartitions) {
        return (weatherWritable.getYear() - 1940) % 3;
    }
}
